home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pov / povlisti.ngs / sample.pov < prev    next >
Encoding:
Text File  |  1992-10-03  |  5.3 KB  |  184 lines

  1. // Persistence of Vision Raytracer
  2. //
  3. // sample file using the letters from alphabet.inc
  4. //
  5.  
  6. #include "colors.inc"
  7. #include "shapes.inc"
  8. #include "textures.inc"
  9. #include "alphabet.inc"
  10.  
  11. camera {
  12.     location <13 14 -11>
  13.     up <0 1 0>
  14.     right <1.333 0 0>
  15.     look_at <0 0 3>
  16.  }
  17.  
  18. /* light sources along the three axes to make the center widget cast the 
  19.      apropriate shadows */
  20.  
  21. object {light_source { <0 0 -1000> colour Gray60  }}
  22. object {light_source { <1000 0 0> colour Gray70  }}
  23. object {light_source { <0 1000 0> colour Gray80  }}
  24.  
  25. object { /* sky - not in direct view, but useful for giving the shiny 
  26.           bits something to reflect */
  27.      sphere { <0 0 0> 1100  }
  28.     texture {
  29.         gradient <0 1 0> 
  30.         colour_map {
  31.             [0 1.01 colour red 0.8 green 0.8 blue 1.0
  32.                 colour red 0.5 green 0.5 blue 0.8]
  33.               }
  34.         scale <1 1100 1>
  35.          }
  36.     texture { Clouds
  37.         scale <100 100 100>
  38.          }
  39.      } /* end of sky object */
  40.  
  41. object { /* Brass plate with cutout letters "TRACE" (and raised border) */
  42.           /* this object takes a csg shape and subtracts the letters from 
  43.           it like a cookie cutter.  Although this example uses 
  44.           infinitely deep letters to cut all the way through, 
  45.           there should be no problem using another plane on the 
  46.           letters to limit how deep they cut into the base object. */
  47.      difference {
  48.           intersection { /* basic rectangular plate */
  49.                plane { <1 0 0> 33  }
  50.                plane { <-1 0 0> 0  }
  51.                plane { <0 1 0> 9  }
  52.                plane { <0 -1 0> 0  }
  53.                plane { <0 0 1> 1.2  }
  54.                plane { <0 0 -1> 0  }
  55.                }
  56.           intersection { /* subtract a smaller rectangle of limited depth 
  57.                          from the base to create the raised edges */
  58.                plane { <1 0 0> 32  }
  59.                plane { <-1 0 0> -1  }
  60.                plane { <0 1 0> 8  }
  61.                plane { <0 -1 0> -1  }
  62.                plane { <0 0 1> 0.2  }
  63.                }
  64.           /* now cut out the letters */
  65.           intersection { al_letter_t 
  66.                translate <2 2 0>
  67.                }
  68.           intersection { al_letter_r
  69.                translate <8 2 0>
  70.                }
  71.           intersection { al_letter_a
  72.                translate <14 2 0>
  73.                }
  74.           intersection { al_letter_c
  75.                translate <20 2 0>
  76.                }
  77.           intersection { al_letter_e 
  78.                translate <26 2 0>
  79.                }
  80.           }
  81.      texture { Brass_Texture }
  82.      bounded_by {
  83.           intersection {
  84.                quadric { Cylinder_X scale <1 5 3> translate <0 5 3>  }
  85.                plane { <1 0 0> 34  }
  86.                plane { <-1 0 0> 1  }
  87.                }
  88.           }
  89.      scale <0.25 0.25 0.25> 
  90.     translate <-8.25 0 0> 
  91.     rotate <45 -45 0>
  92.     translate <4.5 6.8 4.5> 
  93.      } /* end brass plate */
  94.  
  95. object { /* a Goedelian widget consisting of a cube which has 
  96.           been jig-sawed into a different letter along each axis - in this
  97.           case the initials "GEB" for "Goedel, Escher, Bach" the wonderul 
  98.           book from which this idea came. A rather complex looking object, 
  99.           but quite simple to make.  For the best appreciation of the thing, 
  100.           look at the shadows it casts. */
  101.      intersection {
  102.           intersection { al_letter_e  }
  103.           intersection { al_letter_b
  104.                translate <-2.5 -2.5 0>
  105.                rotate <90 -90 0>
  106.                translate <2.5 0 2.5>
  107.                }
  108.           intersection { al_letter_g
  109.                translate <-2.5 -2.5 0>
  110.                rotate <0 -90 0>
  111.                translate <0 2.5 2.5>
  112.                }
  113.           }
  114.      bounded_by {
  115.           sphere { <2.5 2.5 2.5> 7.7  }
  116.           }
  117.     texture { Tom_Wood  reflection 0.1 phong 1.0 phong_size 5 
  118.         scale <0.5 1 10>
  119.         rotate <5 15 0>
  120.          }
  121.     translate <-4 -4 3>
  122.      } /* end block widget */
  123.  
  124. object { /* a last example, "extruded" letters - "POV" in this case 
  125.           (running out of clever ideas) */
  126.     intersection {
  127.         union {
  128.             difference { al_letter_p }
  129.             difference { al_letter_o translate <6 0 0>  }
  130.             difference { al_letter_v translate <12 0 0>  }
  131.              }
  132.         plane { <0 0 -1> 0  }
  133.         plane { <0 0 1> 3 rotate <30 0 0>  }
  134.          }
  135.     texture { gradient <0 1 0>
  136.         colour_map {
  137.             [0 1.01 colour red 0.5 green 0.5 blue 1 
  138.                 colour red 0.5 green 1 blue 0.5]
  139.              }
  140.         scale <5 5 5>
  141.          }
  142.     bounded_by {
  143.         intersection {
  144.             quadric { Cylinder_X scale <1 5 5>  }
  145.             plane { <1 0 0> 17.01  }
  146.             plane { <-1 0 0> 0.01  }
  147.              }
  148.          }
  149.     translate <-6.5 -2.5 0>
  150.     rotate <90 0 0>
  151.     translate <0 -7.6 -2.5>
  152.     rotate <0 -45 0>
  153.      } /* end extruded letters */
  154.  
  155. /* now for some interesting background surfaces to cast the shadows on */
  156. object { plane { <1 0 0> -10  } 
  157.      texture { Brown_Agate
  158.           scale <2 20 15>
  159.           reflection 0.1
  160.           specular 1.0
  161.           roughness 0.01
  162.           }
  163.      }
  164.  
  165. object { plane { <0 1 0> -10  } 
  166.     texture { Sapphire_Agate 
  167.         reflection 0.1 
  168.         specular 1.0
  169.         roughness 0.01
  170.         scale <10 15 20>
  171.          }
  172.      }
  173.  
  174. object { plane { <0 0 1> 15  } 
  175.     texture { Blood_Marble 
  176.         reflection 0.1 
  177.         specular 1.0
  178.         roughness 0.01
  179.         scale <4 6 10>
  180.          }
  181.      }
  182.  
  183.  
  184.